﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RayTracing
{
    public class SceneObject
    {
        public Geometry geometry; //Geometry of the object
        public Texture texture;   //Texture of the object
        public Skin skin;         //Skin of the object

        public SceneObject(Geometry geometry, Texture texture, Skin skin) //Creates a SceneObject with a geometry, texture, and skin
        {
            this.geometry = geometry;
            this.texture = texture;
            this.skin = skin;
        }

        public float distance(Ray ray)                                   //Gets the distance of a ray using geometry
        {
            return geometry.distance(ray);
        }

        public Color colorAt(P3 pointOnSurface, Ray ray)                 //Returns a color at a certian point on the surface of an object 
        {
            return skin.color(pointOnSurface, ray, this);
        }
        
    }
}
